Reference for Wiring version 1.0 Build 0100+ If you have a previous version, use the reference included with your software. If see any errors or have any comments, let us know.
Name | shiftOut() |
||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Examples | int data = 0; // Wiring pin 0 for data int clock = 1; // Wiring pin 1 for clock int strobe = 2; // Wiring pin 2 for the strobe (latch) byte value = 0; void setup() { pinMode(data, OUTPUT); pinMode(clock, OUTPUT); pinMode(strobe, OUTPUT); } void loop() { // pulse the strobe or latch pin on the shift register digitalWrite(strobe, LOW); // writes 'value' to the register shiftOut(data, clock, LSBFIRST, value); digitalWrite(strobe, HIGH); delay(1000); value = value + 1; } |
||||||||||||
Description | The shiftOut() method writes data to a pin one bit at a time. It can start from the most or the least significant bit (starts from leftmost or rightmost bit). This method is very useful to manage shift registers (output), which are devices that convert data from serial to parallel using one Wiring pin for sending data, one for the clock, and one for the strobe (latch). | ||||||||||||
Syntax | shiftOut(dataPin,clockPin,bitOrder,data) shiftOut(dataPin,clockPin,bitOrder,data,count) shiftOut(dataPin,clockPin,bitOrder,data,count,delayTime) |
||||||||||||
Parameters |
|
||||||||||||
Returns | none | ||||||||||||
Usage | Application | ||||||||||||
Related | shiftIn() MSBFIRST LSBFIRST |